<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
</head>
<body>
<script>
    $(function(){
        //
        $.ajax({
            //请求方式
            type : "GET",
            //请求的媒体类型
            contentType: "application/json;charset=UTF-8",
            //请求地址
            url : "http://127.0.0.1:8888/song/detail",
            //数据，json字符串
            data : {id:"13"},
            //请求成功
            success : function(result) {
                for(var i = 0;i < result.length;i++)
                {
                    var id = result[i].id;
                    var name = result[i].name;
                    console.log(id + ":" + name);
                }
            },
            //请求失败，包含具体的错误信息
            error : function(e){
                console.log(e.status);
                console.log(e.responseText);
            }
        });
    });
</script>
</body>
</html>